<?php

namespace App\Http\Requests;

use Dcat\Admin\Admin;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;

class BaseRequest extends FormRequest
{
    protected function failedValidation(Validator $validator)
    {
        $message = show_error($validator);
        if ($message){
            admin_exit(Admin::json()->error($message));
        }
    }
}
